package com.yuerenjf.yuerenjinfu.utils;

import android.widget.TextView;

/**
 * Created by Administrator on 2016/7/18.
 */
public class DaysTimer extends CountDownTimerUtil {
    private TextView textView;

    /**
     * @param millisInFuture    The number of millis in the future from the call
     *                          to {@link #start()} until the countdown is done and {@link #onFinish()}
     *                          is called.
     * @param countDownInterval The interval along the way to receive
     *                          {@link #onTick(long)} callbacks.
     */
    public DaysTimer(TextView textView, long millisInFuture, long countDownInterval) {
        super(millisInFuture, countDownInterval);
        this.textView = textView;
    }

    @Override
    public void onTick(long millisUntilFinished) {
        if(textView!=null){
            textView.setText(DataFormatUtil.getHours(millisUntilFinished));
        }
    }

    @Override
    public void onFinish() {
        if(textView!=null){
            textView.setText("立即投资");
        }

    }
}
